package com.wl.api.controller.business;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.wl.api.common.utils.JsonObject;
import com.wl.api.controller.base.CommonController;
import com.wl.api.dto.system.OmsIndexInformationDTO;
import com.wl.api.dto.system.OmsProductServiceDTO;
import com.wl.api.service.business.IOmsIndexInformationService;
import com.wl.api.service.business.IOmsProductServiceService;
/**
 * 客户产品服务推荐
 * @author Administrator
 *
 */
@RestController
@RequestMapping("/external/recommend/product")
public class RecommendProductController extends CommonController {

	@Autowired
	IOmsProductServiceService productService;
	
	@RequestMapping("/query")
	public JsonObject getItemList(OmsProductServiceDTO param) {
		JsonObject json = JsonObject.getInstance();
		if(param.getStatus() == null) {
			param.setStatus(1);
		}
		json.setPage(productService.getItemList(param));
		setJsonMessage(json);
		return json;
	}  
	@RequestMapping("/query/{id}")
	public JsonObject getDetail(@PathVariable("id")Integer id) {
		JsonObject json = JsonObject.getInstance();
		json.setData(productService.selectById(id));
		setJsonMessage(json);
		return json;
	}
	
}
